计算机与现代化 ›› 2012, Vol. 1 ›› Issue (200): 82-04.doi: 10. 3969/j. issn. 1006-2475.2012.04.022

• 应用与开发 • 上一篇    下一篇

一种用于指针程序的形状分析方法

刘 刚,胡凯平,宋发兴   

  1. 中国人民解放军63898部队,河南 济源 454650
  • 收稿日期:2011-11-24 修回日期:1900-01-01 出版日期:2012-04-16 发布日期:2012-04-16

An Approach for Analysis of Pointer Programs

LIU Gang, HU Kai-ping, SONG Fa-xing   

  1. No. 63898 Troop of Chinese People’s Liberation Army, Jiyuan 454650, China
  • Received:2011-11-24 Revised:1900-01-01 Online:2012-04-16 Published:2012-04-16

摘要: 指针程序的分析一直是研究热点。本文提出一种基于形状图逻辑的形状分析方法,其中形状分析采用形状图来表达程序中指针的指向和相等关系,并用形状图逻辑来进行推理。形状图逻辑是一种把形状图看成有关指针的断言,并在此基础上对Hoare逻辑进行扩展而得到的程序逻辑。首先介绍所提出的形状图和形状图逻辑;然后在此基础之上,设计一种基于形状图逻辑的形状分析方法。

关键词: 形状图, 形状图逻辑, Hoare逻辑, 形状分析, 程序分析

Abstract: Analysis of pointer programs has already become a hotspot research in the field of programming languages. This paper takes an approach to the problem by doing shape analysis, which uses a shape graph to express points-to and equivalence relations among pointers in a program, and uses a shape graph logic to infer programs. The shape graph logic is an extension to Hoare logic by regarding shape graphs as assertions about pointers directly. First, this paper describes the proposed shape graph and shape graph logic. Then based on the shape graph logic, it designs a method for shape analysis on pointer programs.

Key words: shape graph, shape graph logic, Hoare logic, shape analysis, program analysis